Return to doc.sitecore.com

Action When All Publishing Tasks are Completed
Prev Next

Author: Dmitry Baranov
Posted: 4/26/2010 1:04:50 AM

Question:
The publish:end event is launched every time when publishing for every target in every language has ended. How to perform actions when ALL publishing tasks have been completed?

Answer:
Add a custom processor to the end of the job pipeline:

      <job>
                ...
        <processor type="Sitecore.Support.Publishing.Ender, YourAssemblyName" method="SignalPublishEnd" />
      </job>

The code should look as the following:

namespace Sitecore.Support.Publishing
{
    public class Ender
    {
        public static void SignalPublishEnd(JobArgs args)
        {
            Job job = args.Job;
            if (job.Name == "Publish")
            {
// TODO: Add actions
            }
        }
    }
}


Prev Next